package com.mlk.reback.api;

import com.mlk.core.component.page.Pager;
import com.mlk.core.util.ServerResponse;
import com.mlk.reback.po.EngRebackTicket;
import com.mlk.reback.service.EngRebackTicketService;
import com.mlk.reback.vo.EngRebackTicketVO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/reback")
public class EngRebackTicketAPI {

    @Resource
    private EngRebackTicketService engRebackTicketService;

    /**
     * 新增换购单
     * @return
     */
    @PostMapping("addTicket")
    public ServerResponse addTicket(@RequestBody EngRebackTicketVO ticket){
        return this.engRebackTicketService.addTicket(ticket);
    }

    /**
     * 查询我的换购单
     * @return
     */
    @GetMapping("queryMyReback")
    public Pager queryMyReback(String openId){
        return this.engRebackTicketService.queryMyReback(openId);
    }

    /**
     * 查询换购单的详情信息
     * @return
     */
    @GetMapping("queryDetail")
    public ServerResponse queryDetail(String ticketId){
        return this.engRebackTicketService.queryDetail(ticketId);
    }

    /**
     * 智能输入
     * @return
     */
    @GetMapping("AIInput")
    public ServerResponse AIInput(EngRebackTicket ticket){
        return this.engRebackTicketService.AIInput(ticket);
    }
}
